{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- form start -->
        <form class="am-form form-validation view-save" action="{{:MyUrl('admin/books/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/books/index', $params)}}" enctype="multipart/form-data">
            <legend>
                <span class="fs-16">
                    {{if empty($data['id'])}}
                    书单添加
                    {{else /}}
                    书单编辑
                    {{/if}}
                </span>
             <a href="javascript:window.history.back();" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
            </legend>
            <!-- 基础信息 -->
            <div id="goods-nav-base" class="division-block"> 
                <div class="am-form-group">
                    <label>书单名称</label>
                    <input type="text" name="title" placeholder="书单名称" maxlength="160" data-validation-message="书单名称 最多160个字符" class="am-radius" {{if !empty($data)}} value="{{$data.title}}"{{/if}} />
                           
                </div>
                <div class="am-form-group">
                    <label>书单描述</label>
                    <input type="text" name="describe" placeholder="书单描述" maxlength="160" data-validation-message="书单描述 最多160个字符" class="am-radius" {{if !empty($data)}} value="{{$data.describe}}"{{/if}} />
                </div>
                       <div class="am-form-group am-form-file">
                            <label class="block">主题图片</label>
                            <ul class="plug-file-upload-view goods-recommended-images-view" data-form-name="layout" data-max-number="1" data-dialog-type="images">
                                {{if !empty($data['layout'])}}
                                <li>
                                    <input type="text" name="layout" value="{{$data.layout}}" />
                                    <img src="{{$data.layout}}" />
                                    <i>×</i>
                                </li>
                                {{/if}}
                            </ul>
                            <div class="plug-file-upload-submit" data-view-tag="ul.goods-recommended-images-view">+上传图片</div>
                        </div>   
                    </div>
                      <div class="am-form-group">
                            <label class="block">是否推荐 </label>
                            <input name="is_recommended" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if isset($data['is_recommended']) and $data['is_recommended'] eq 1}}checked="true"{{/if}} />
                        </div>
                    <div class="am-form-group am-form-group-refreshing">
                        <input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
                               <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
                    </div>
                    </form>
                    <!-- form end -->
                </div>
            </div>
            <!-- right content end  -->
            
      
            <!-- footer start -->
            {{include file="public/footer" /}}
            <!-- footer end -->
 